package chapterTwo.equalObject;

public class ObjectOne implements Comparable<ObjectOne>{

	private int val;
	public ObjectOne(int val) {
		this.val=val;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ObjectOne one=new ObjectOne(8);
		ObjectOne two=new ObjectOne(3);

		if(one.equals(two) ){
			System.out.println("they are equal");
			
		}else{
			System.out.println("NOT equal");
			
		}
		
		
	}

	@Override
	public int compareTo(ObjectOne o) {
		
		return this.val-o.val ;
	}

}
